#!/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
export PATH

# 主目录
WORK_DIR="/home/"
# 二级目录
MAIN_DIR="taoshanghaoke/"
# 仓库分支名称
DEV_BRANCH="dev"
# 临时分支名称
TMP_BRANCH="temp"
# 目录用户组
GROUP_NAME="apache"
# 目录用户
USER_NAME="apache"

cd "${WORK_DIR}${MAIN_DIR}" && git fetch origin "${DEV_BRANCH}:${TMP_BRANCH}" && git merge ${TMP_BRANCH} && git branch -d ${TMP_BRANCH}
cd "${WORK_DIR}" && chown -R "${GROUP_NAME}:${USER_NAME}" "${MAIN_DIR}"